package com.example.sqldemo.Service;


import com.example.sqldemo.mapper.UserMapper;
import com.example.sqldemo.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class UserService {


    @Autowired
    private UserMapper userMapper;


    @Transactional
    public void insertUser(){
        User user = new User();
        user.setName("王五");
        user.setAge(88);
        userMapper.insertUser(user);
    }
}
